package com.tenton.netty.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @ClassName: NettyConfig
 * @Description:
 * @Author： tangdong
 * @Date： 2024/6/25
 */
@Component
public class NettyConfig {
    /**
     * 组播ip
     */
    public static String locIp;

    @Value("${netty.loc-ip}")
    public void setLocIp(String locIp) {
        NettyConfig.locIp = locIp;
    }

    /**
     * 接收组播ip
     */
    public static String multicastSubIp;

    @Value("${netty.multicast.sub.ip}")
    public void setMulticastSubIp(String ip) {
        NettyConfig.multicastSubIp = ip;
    }

    /**
     * 接收UDP数据组播端口
     */
    public static Integer multicastSubPort;

    @Value("${netty.multicast.sub.port}")
    public void setMulticastSubPort(Integer port) {
        NettyConfig.multicastSubPort = port;
    }


    /**
     * 发送ip 单播/组播 ip
     */
    public static String pubIp;

    @Value("${netty.pub.ip}")
    public void setPubIp(String ip) {
        NettyConfig.pubIp = ip;
    }

    /**
     * 发送UDP数据端口 单播/组播端口
     */
    public static Integer pubPort;

    @Value("${netty.pub.port}")
    public void setPubPort(Integer port) {
        NettyConfig.pubPort = port;
    }

    /**
     * TCP服务端发送的端口
     */
    public static Integer tcpPubPort;

    @Value("${netty.tcp.pub.port}")
    public void setTcpPubPort(Integer port) {
        NettyConfig.tcpPubPort = port;
    }
}
